// JavaScript Document
//删除数据提醒
function dconfirm(url,a){
	if(confirm(a)){
		location.href=url;
		}
	}

function selfurl()
{
	var url = "../custom/listfield.cbs?rid=custom";
	self.location.href=url;
}


function checkgroup(whichname)
{
	srcElement = window.event.srcElement; 
	thisgroup = srcElement.id;
	var express1;
	express1="";
  frms = document.zyform;
  var zl1 = top.dbtop.document.form1;
	express = zl1.selecttree.value;
	if( express == "" )
		express =",";
 
  for (var i=0;i<frms.elements.length;i++)
	{
			var zl = frms.elements[i];
			if(zl.id == whichname)
			{
				zl.checked=true;
				var ridval = zl.value;
				begvar   = ridval.indexOf("_");
				ridnames = ridval.substring(begvar+1);
				var ridval = ridval.substring(0,begvar);
				if (document.all(thisgroup).checked==false)
				{
						zl.checked=false;
						if( express.indexOf(","+ridval+",") != -1)
						{
							express = express.replace(","+ridval+",",",");
						}
				}
				else
				{
					zl.checked=true;
					if( express.indexOf(","+ridval+",") == -1)
						express1 += ridval +",";
				}
	    }
	}
	if (document.all(thisgroup).checked)
		zl1.selecttree.value = express + express1;
	else
		zl1.selecttree.value = express;
	//zl1.selecttree.value = express + express1;
	//document.all(whichname.replace("indexbar","clew")).style.display = "none";
	parent.main.location.href="../treecode/treecode.cbs";
 
	frms.groupnum.value=1;
	return true;
}
function alldb(checkflag)
{
	var express=",";
  if( checkflag == 0)
  	flag=false;
  else
  	flag=true;

  frms = document.zyform;
 	for (var i=0;i<frms.elements.length;i++)
	{
			var zl = frms.elements[i];
	   	if( ((zl.id == "indexbar0") || (zl.id == "indexbar1") || (zl.id == "indexbar2") || (zl.id == "indexbar3")))
	    {
	    	 zl.checked=flag;
				var ridval = zl.value;
				begvar   = ridval.indexOf("_");
				ridnames = ridval.substring(begvar+1);
				var ridval = ridval.substring(0,begvar);
				express += ridval + ",";
				
	    }
	}
	if(flag == false)
	{
		express ="";
	}
 
	var zl1 = top.dbtop.document.form1;
	zl1.selecttree.value=express;
	frms.groupnum.value=0;
 	parent.main.location.href="../treecode/treecode.cbs";
 	/*
	if(flag)
	{
		zl1.pagename.value="indexbar";
		parent.main.location.href="../tool/indexbar.cbs";
	}
	else
	{
		zl1.pagename.value="indexbar0";
		parent.main.location.href="../tool/indexbar0.cbs";
	}
 	*/
}
function set(num)
{
	var express_tmp = ",";
	var express = ",";
	var zl = top.menu.document.zyform;
	var ridnum = 0;
		var stemp="";
	for (var i=0; i < zl.length; i++)
	{
		if (zl.elements[i].checked)
		{
			var ridval = zl.elements[i].value;
			begvar   = ridval.indexOf("_");
			ridnames = ridval.substring(begvar+1);
			var ridval = ridval.substring(0,begvar);
			if (ridnames != stemp)
				ridnum ++;
			stemp = ridnames;
			express += ridval + ",";
			
			//修改当前父节点中的checkbox的属性
			if( ridnames =="on")
			{
				document.all(zl.elements[i].id).checked=false;
			}
		}
	}
	var zl1 = top.dbtop.document.form1;
	zl1.selecttree.value=express;
 
	dbcount = express.split(",").length;
	parent.main.location.href="../treecode/treecode.cbs";
	/*	
	if( ridnum ==1)
	{
			zl1.pagename.value=ridnames;	
			parent.main.location.href="../tool/"+ridnames+".cbs?express="+express;
	}
	else
	{
		zl1.pagename.value="indexbar";
		parent.main.location.href="../tool/indexbar.cbs?express="+express;
	}
	*/
	return true;
}
function abc(rid,checkdb)
{	
	if( checkdb == -1)
	{
		alert("请确认插入相应数据库的光盘！或使用本系统的其他类型产品。如有需要，请致电：全国人大信息中心法规部  010-63093823北京开元讯业科技有限公司  010-81781166");
		return false;
	}
	//var zl1 = top.dbtop.document.form1;
	//zl1.selecttree.value=rid;
	//parent.main.location.href="../page/browse.cbs?rid="+rid;
}
function turnit(ss){
	
	aa = ss.id;
	if(ss.style.display=="none"){
		ss.style.display="";
		document.all(aa+"_1").src= "menu_data/menu_tee_minus.gif";
		document.all(aa+"_2").src= "menu_data/menu_folder_open.gif";
	}else{
		ss.style.display="none";
		document.all(aa+"_1").src= "menu_data/menu_tee_plus.gif";
		document.all(aa+"_2").src= "menu_data/menu_link_default.gif";
	}
}